package com.bkgy.controller.completeflow.controller;

import com.bkgy.controller.completeflow.entity.CompleteFlowRequest;
import com.bkgy.controller.completeflow.service.CompleteFlowService;
import com.bkgy.sys.common.entity.ResultData;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;


/**
 * 全流程成材率分析
 */
@RestController
@RequestMapping("/comlete")
public class CompleteFlowController {

    @Autowired
    private CompleteFlowService service;

    @Operation(summary = "全流程成材率分析统计", description = "根据时间条件统计各个产线成材率数据")
    @PostMapping("/getCompleteFlowData")
    public ResultData getCompleteFlowData(@RequestBody @Valid CompleteFlowRequest request) {
        return service.getCompleteFlowData(request);
    }

    @Operation(summary = "全流程成材率分析班组统计", description = "根据时间条件统计各个产线成材率班组数据")
    @PostMapping("/getCompleteFlowCrewData")
    public ResultData getCompleteFlowCrewData(@RequestBody @Valid CompleteFlowRequest request) {
        return service.getCompleteFlowCrewData(request);
    }

    @Operation(summary = "全流程成材率分析品规统计", description = "根据时间条件统计各个产线成材率品规数据")
    @PostMapping("/getCompleteFlowSpeciData")
    public ResultData getCompleteFlowSpeciData(@RequestBody @Valid CompleteFlowRequest request) {
        return service.getCompleteFlowSpeciData(request);
    }

    @Operation(summary = "全流程损失指标统计", description = "根据时间条件统计各个产线损失指标数据")
    @PostMapping("/getCompleteFlowLossData")
    public ResultData getCompleteFlowLossData(@RequestBody @Valid CompleteFlowRequest request) {
        return service.getCompleteFlowLossData(request);
    }

}
